package com.ledtechdesign.auth;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.ledtechdesign.afcs.IAuthToken;
import com.ledtechdesign.service.Utils;

public class DefaultAuthToken implements IAuthToken {
	Log logger = LogFactory.getLog(this.getClass());

	private String prefix; // 
	private String token;
	private boolean guest;
	
	

	public boolean isGuest() {
		return guest;
	}


	DefaultAuthToken( String tokenParam,String prefix,boolean isGuestParam) {
		this.prefix = prefix;
		this.guest = isGuestParam;
		this.token = Utils.base64(tokenParam);
	}

	public String getTokenString() {
		return (this.prefix +"="+ this.token);
	}

	@Override
	public String toString() {
		return this.getTokenString();
	}

}
